import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'

import Index from '@/components/index/index'

import Users from '@/components/users/users'

import Rights from '@/components/rights/rights'
import Roles from '@/components/rights/roles'

import Goods from '@/components/goods/goods'
import addGoods from '@/components/goods/addgoods'
import Categories from '@/components/goods/categories'
import Params from '@/components/goods/params'

import Orders from '@/components/orders/orders'

import Reports from '@/components/reports/reports'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/home/index',
      children:[
        {
          path: 'index',
          name: 'Index',
          component: Index
        },        
        {
          path: 'users',
          name: 'Users',
          component: Users
        },
        {
          path: 'rights',
          name: 'Rights',
          component: Rights
        },
        {
          path: 'roles',
          name: 'Roles',
          component: Roles
        },
        {
          path: 'goods',
          name: 'Goods',
          component: Goods
        },
        {
          path: 'addgoods',
          name: 'addGoods',
          component: addGoods
        },        
        {
          path: 'categories',
          name: 'Categories',
          component: Categories
        },
        {
          path: 'params',
          name: 'Params',
          component: Params
        },
        {
          path: 'orders',
          name: 'Orders',
          component: Orders
        },
        {
          path: 'reports',
          name: 'Reports',
          component: Reports
        },
      ]
    }    
  ]
})
